<?php
echo $javascript->link('passchk.js',false);
?>
<h2>Global Settings</h2>

<div class="settings form">
    Please fill in details below. All settings can be changed later.
    <?php echo $form->create(array('name'=>'passchk_form','action'=>'syssettings')); ?>
    <fieldset>
        <legend>Administrator details</legend>
        <div class="fieldset-inside">
            <?php
                echo $form->input('name', array('size'=>'40','class'=>'required','value'=>'Administrator','label'=>'Name'));
                echo $form->input('username',array(
                    'value'=>'admin',
                    'class'=>'required',
                    'label'=>'Username'
                ));
                echo $form->input('password',array(
                    'class'=>'required',
                    'type'=>'password',
                    'value'=>'',
                    'label'=>'Password'
                )); //echo "AlphaNumeric Only";
                echo '<span id="passchk_result"></span>';
                echo $form->input('password_confirm',array(
                    'class'=>'required',
                    'type'=>'password',
                    'label'=>'Confirm password',
                ));
               // echo $form->error('password2');
                echo $form->hidden('superuser',array('value'=>1));     
                echo $form->input('email',array('size'=>'40','class'=>'required','label'=>'Email'));
            ?>
        </div>
    </fieldset>
    <fieldset>
        <legend>Agency Details</legend>
        <div class="fieldset-inside">
            <?php
                echo $form->input('agency_name',array('value'=>$agency_name,'size'=>'40','label'=>'Agency Name'));
                echo $form->input('agency_address',array('value'=>$agency_address,'size'=>'40','label'=>'Agency Address'));
                echo $form->input('agency_slogan',array('value'=>$agency_slogan,'size'=>'40','label'=>'Agency Slogan'));
            ?>
        </div>
    </fieldset>
    <fieldset>
        <legend>Email Settings</legend>
        <div class="fieldset-inside">
            <?php
                echo $form->input('email_method',array('type'=>'select','options'=>array('native'=>'PHP Mailer','smtp'=>'SMTP','sendmail'=>'Sendmail'),'value'=>'native','label'=>'Email Method'));
                echo $form->input('email_from_name',array('value'=>!empty($email_from_name)? $email_from_name:'MyMeeting Admin','label'=>'Email (From)','size'=>'40'));
                echo $form->input('email_from',array('value'=>$email_from,'label'=>'Email','size'=>'40'));
                echo "<span class='note'> name@domain.com</span>";
                echo $form->input('smtp_host',array('value'=>'localhost','label'=>'SMTP Host','size'=>'40'));
                echo "<span class='note'> smtp.domain.gov.my</span>";
                echo $form->input('smtp_port',array('value'=>'25','label'=>'SMTP Port'));
                echo $form->input('smtp_username',array('label'=>'SMTP Username'));
                echo $form->input('smtp_password',array('label'=>'SMTP Password'));
                echo $form->input('sendmail',array('value'=>'/usr/sbin/sendmail','label'=>'Sendmail Path'));
            ?>
        </div>
    </fieldset>
    <fieldset>
        <legend>Global settings</legend>
        <div class="fieldset-inside">
            <?php
                echo $form->hidden('defaultrole',array('value'=>'admin'));
                echo $form->input('server_url',array('value'=>$server_url,'label'=>'Server URL'));
                echo "<span class='note'> http://www.agensi.gov.my, http://www.agensi.gov.my/mymeeting</span>";
                echo $form->input('date_format',array('value'=>'d/m/Y','label'=>'Date Format'));
                echo $form->input('time_format',array('value'=>'g:i a','label'=>'Time Format'));
                echo $form->input('days_to_remind',array('value'=>'7','label'=>'Days to Remind'));
                echo "<span class='note'>Number of days MyMeeting will start sending reminders to members to update status</span>";
                echo $form->input('days_to_confirm_attendance',array('value'=>'3','label'=>'Days to Confirm Attendance'));
                echo "<span class='note'>Default number of days for members to confirm their attendance</span>";
                echo $form->input('check_status',array('type'=>'checkbox','label'=>'Status need to be keyed in before minute approval'));
                echo $form->input('search_by_group',array('type'=>'checkbox','label'=>'Enable the feature that choose user by group'));
            ?>
        </div>
    </fieldset>
    <p>&nbsp;</p>
    <?php
        echo $form->button('Back',array('type'=>'button', 'onclick'=>'parent.location="language"'));
        echo '&nbsp;';
        if (count($syssettingset))
            echo $form->button('Submit',array('type'=>'submit'));
        else 
            echo $form->button('Next',array('type'=>'button','onclick'=>'parent.location="success"'));
        echo $form->end();
    ?>
</div>


